//
//  UIView+Extension.swift
//  SinaWeibo
//
//  Created by 张洪毓 on 15/11/17.
//  Copyright © 2015年 张洪毓. All rights reserved.
//

import UIKit

extension UIView {
    
    func navController() -> UINavigationController? {
        
        var next = self.nextResponder()
        
        repeat {
            
            if next is UINavigationController {
                
                return next as? UINavigationController
            }
            
            next = next?.nextResponder()
        
        }while(next != nil)
        
        return nil
    }
    
}

